package com.ruoyi.recycle.dto;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("分页查询引流数据请求体")
public class AttractRecordQueryDTO implements Serializable {
    private static final long serialVersionUID = 7579967687638318533L;

    @ApiModelProperty(name = "currentPage", value = "当前页")
    private Integer currentPage;
    @ApiModelProperty(name = "pageSize", value = "页面大小")
    private Integer pageSize;

    @ApiModelProperty(name = "searchTimeBegin", value = "搜索开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date searchTimeBegin;

    @ApiModelProperty(name = "searchTimeEnd", value = "搜索终止时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date searchTimeEnd;

    @ApiModelProperty(name = "salesmanId", value = "业务员ID")
    private Long salesmanId;

    @ApiModelProperty(name = "maxAttractDay", value = "是否今日拉新最高,需要查询今日拉新最高时传true, 否传false")
    private Boolean maxAttractDay;

    @ApiModelProperty(name = "maxAttractMonth", value = "是否月拉新最高,需要查询月拉新最高时传true, 否传false")
    private Boolean maxAttractMonth;

    @ApiModelProperty(name = "shopCategory", value = "平台类型")
    private String shopCategory;

    @ApiModelProperty(name = "merchantId", value = "综合站ID", required = true)
    private Long merchantId;
    @ApiModelProperty(name = "searchType", value = "搜索类型，引流门店页面时,值为平台,引流达人页面时为达人")
    private String searchType;

    @ApiModelProperty(name = "maxAttractMonth", value = "是否月订单最高，需要查询月订单最高时传true, 否传false")
    private Boolean maxOrder;

    public void setSearchTimeEnd(Date searchEnd) {
        this.searchTimeEnd = DateUtil.offsetSecond(searchEnd, 86399).toJdkDate();

    }

}
